<?php

namespace App\Http\Requests\Admin\Permission;
use App\Http\Requests\Request;

class CreateRequest extends Request{
    public function authorize(){
        return true;
    }
    public function rules(){
        return [
            'name' => 'required|max:50|unique:permissions,name',
            'display_name'=>'required',
            'description'=>'required',
        ];
    }
    public function messages(){
        return [
            'name.required' => '权限标识必须填写',
            'name.max' => '权限标识最多50个字符',
            'name.unique' => '该权限标识已存在',
            'display_name.required' => '权限名称必须填写',
            'description.required'=>'权限描述不能为空！',
        ];
    }
}
